﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class UIDreg : MonoBehaviour {

    public Image Left;
    public Image Right;

	// Use this for initialization
	void Start () {
        Left = GameObject.Find("Left").GetComponent<Image>();
        Right = GameObject.Find("Right").GetComponent<Image>();

        InvokeRepeating("Show", 0.1f, 1f);
        InvokeRepeating("Dear", 0.6f, 1);
    }
	
	void Show()
    {
        Left.gameObject.SetActive(false);
        Right.gameObject.SetActive(true);
    }

    void Dear()
    {
        Left.gameObject.SetActive(true);
        Right.gameObject.SetActive(false);
    }

    private void OnMouseDown()
    {
        Destroy(this.gameObject);
    }
}
